﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WCFStudy;

namespace WCFService
{
    public class CalculatorService : ICalculator
    {
        public double Add(double x, double y)
        {
            return  x + y;
        }

        public double Subtraction(double x, double y)
        {
            return x - y;
        }

        public double Multipication(double x, double y)
        {
            return x * y;
        }

        public double Division(double x, double y)
        {
            if (y == 0)
                throw new DivideByZeroException("被除数为零！");
            return x / y;
        }
    }
}
